CC = gcc
AR = ar cru
SRC =  ../antx/antx/antx.cc  ../antx/antx/thread.cc ../antx/antx/exmonwaiter.cc \
  ../antx/antx/clientAcl.cc   \
  scheduler/Helper.cc


CFLAGS = -Wall -D_REENTRANT -D_GNU_SOURCE -fPIC  -g3 `pkg-config --cflags --libs glib-2.0`
SOFLAGS = -shared
LDFLAGS =   # -lresolv

LINKER = $(CC)
LINT = lint -c
RM = /bin/rm -f

LIBS = -L/home/y/lib -L/usr/local/lib -L/usr/lib  \
	   -lmemcached -levent  -pthread  \
	   -lstdc++ 

INCLUDES =  -I/home/y/include -I/usr/local/include -I../antx/antx -I./scheduler  -I/usr/include   
OPTFLAG = -fno-default-inline -D_THREAD_SAFE  -D_DEBUG  

CFLAGS  += $(INCLUDES) 
CFLAGS  += $(OPTFLAG) 
LDFLAGS += $(LIBS) 
#--------------------------------------------------------------------
OBJS = $(SRC:.cc=.o)
TARGET = bin/scheduler
#--------------------------------------------------------------------
all:$(TARGET)
$(TARGET):$(OBJS)
	$(LINKER) $(LDFLAGS) $(OBJS) -o $@

clean:
	@( $(RM) *.o $(TARGET) )
	rm scheduler/*.o ../antx/antx/*.o  
#--------------------------------------------------------------------
# make rule
%.o : %.cc
	$(CC) $(CFLAGS) -c $^ -o $@	

%.o : %.cpp
	$(CC) $(CFLAGS) -c $^ -o $@	

